package com.smbms.service.bill;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.smbms.dao.bill.BillMapper;
import com.smbms.entity.Bill;

@Service("billService")
public class BillServiceImpl implements BillService{
	
	@Resource
	private BillMapper billMapper;
	
	@Override
	public List<Bill> getBillList(String productName,Integer providerId,Integer isPayment,Integer fromIndex,Integer pageSize) {
		return billMapper.getBillList(productName, providerId, isPayment, fromIndex, pageSize);
	}

	@Override
	public int count(String productName, Integer providerId, Integer isPayment) {
		return billMapper.count(productName, providerId, isPayment);
	}

	@Override
	public boolean add(Bill bill) {
		if(billMapper.add(bill)>0){
			return true;
		}
		return false;
	}

	@Override
	public boolean delete(int id) {
		if(billMapper.delete(id)>0){
			return true;
		}
		return false;
	}

	@Override
	public boolean update(Bill bill) {
		if(billMapper.update(bill)>0){
			return true;
		}
		return false;
	}

	@Override
	public Bill getBillById(int id) {
		return billMapper.getBillById(id);
	}

}
